package com.springboot.demo.aop;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/*
 *DATE:2025/7/8
 */
@Component
@Aspect
public class Monkey {
    @Pointcut("execution(* com.springboot.demo.aop.Fayuge.perform(..))")
    public void pc(){}

    @Before("pc()")
    public void takeSeat()
    {
        System.out.println("猴子坐下");
    }

    @Before("pc()")
    public void turnOffCellPhone()
    {
        System.out.println("猴子关手机");
    }

    @AfterReturning("pc()")
    public void applaud()
    {
        System.out.println("猴子鼓掌");
    }

    @AfterThrowing("pc()")
    public void throwEggs()
    {
        System.out.println("猴子抛鸡蛋");
    }
}
